PreviewShowData
ThePreviewShowData
function allows you to display a preview if your preview component does not handle events.
pascal ComponentResult PreviewShowData (pnotComponent p, OSType dataType, Handle data, const Rect *inHere);
p
- Specifies your preview component. You obtain this identifier from
the Component Manager'sOpenComponent
function. See the chapter "Component Manager" in Inside Macintosh: More Macintosh Toolbox for details.dataType
- Contains the type of handle pointing to the data to be displayed in the preview.
data
- Contains a handle to the data, which is typically the same as the subtype of your preview component.
inHere
- Contains a pointer to a rectangle that defines the area into which you draw the preview. The current port is set to the correct graphics port
for drawing. You must not draw outside the given rectangle.DESCRIPTION
If your preview component can display the data for the preview quickly enough that it does not need a cache (that is, you have set thepnotComponentNeedsNoCache
flag), you should consider thePreviewShowData
function an initialization function. Therefore, you should remember the location of the preview rectangle and set up any necessary data structures. An update event is generated after this function for your initial drawing. In this case, the type of the handle in thedata
parameter is an alias (that is, it is therAliasType
resource type), and the handle contains an alias to the file to be previewed.
Main | Top of Section | What's New | Apple Computer, Inc. | Find It | Feedback | Help